package gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;

import network.Reso;

public class ConsoleResoUI extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L;
	private Reso reso;
	private ConsoleReso consoleReso;
	
	public ConsoleResoUI(Reso r) {
		super();
		this.reso = r;
		this.consoleReso = new ConsoleReso(this);
		
		java.awt.Dimension dScreen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
		this.setSize(350, dScreen.height);
		//this.setLocationRelativeTo(this.getParent());
		this.setLocation(dScreen.width-this.getWidth(),0);
		this.setTitle("Reso");
		this.add(consoleReso, BorderLayout.CENTER);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		this.reso.addProcessus();
	}

	public void affiche(String s) {
		this.consoleReso.affiche(s);
	}
}
